import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/HomePage.vue'
import about from '@/views/about/index.vue'
import other from '@/views/other.vue'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      component: about
    },
    {
      path: '/other',
      name: 'other',
      component: other
    }
  ]
})

// router.beforeEach((to, from, next) => {
//   console.log(to, from)
//   if (to.name === from.name) {
//     next(false);
//   } else {
//     next();
//   }
// });

export default router